define([], function() {
	'use strict';
	var ellipse = {
		points : [],
		paintDot : function(i) {
			var x = 300, y = 300, a = 200, b = 100,
				dot = document.createElement("div"), 
				radian = (Math.PI / 180) * i, 
				x1 = a * Math.sin(radian) + x, 
				y1 = y - (b * Math.cos(radian));
			this.points[i] = [];
			this.points[i][0] = x1 - 3;
			this.points[i][1] = y1 - 3;
			dot.className = "ab";
			dot.style.cssText = "left:" + x1 + "px;top:" + y1 + "px;"
			document.body.appendChild(dot);
		},
		paintEllipse : function(callback){
			var i = 0, self = this, timer;
			timer = setInterval(function(){
				if(i>=360){
					clearInterval(timer);
					callback && callback();
					return;
				}
				self.paintDot(i);
				i++;
	        },10)
		},
		revolution : function(){
			var earth = document.querySelector(".move"), z = 0, self = this, timer;
			timer = setInterval(function(){  
	            if(z >= 360) z = 0;
	            earth.style.cssText = "left:" + self.points[z][0] + "px;top:" + self.points[z][1] + "px;";  
	            z++;  
	        },10)
		}
	}
	
	ellipse.paintEllipse(function(){ellipse.revolution();});
});
